package cn.ococci.dm.Main.Adapter.Base;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.List;

/**
 *  Created by cyan on 15/9/23.
 */
public abstract  class AbNormalAdapter<T> extends AbBaseAdapter<T,BaseViewHolder> {

    public AbNormalAdapter(Context c, int layoutResId) {
        super(c, layoutResId);
    }

    public AbNormalAdapter(Context context, ArrayList<T> data, IMultiItemType<T> multiItemSupport) {
        super(context, data, multiItemSupport);
    }

    public AbNormalAdapter(Context c, int layoutResId, List<T> data) {
        super(c, layoutResId, data);
    }

    @Override
    protected BaseViewHolder getAdapterHelper(int position, View convertView, ViewGroup parent) {

        if (mMultiItemSupport != null){
            return BaseViewHolder.obtain(
                    mContext,
                    convertView,
                    parent,
                    mMultiItemSupport.getLayoutId(position, mData.get(position)),
                    position);
        } else  {
            return BaseViewHolder.obtain(mContext, convertView, parent, layoutResId, position);
        }
    }
}
